#include "drawshape.h"

DrawShape::DrawShape(){}

DrawShape::DrawShape(ShapeType typ, int left, int top, int right, int bottom)  : type(typ), x1(left), x2(top), y1(right), y2(bottom) {}

DrawShape::DrawShape(ShapeType typ, QRect coord)
{
    type = typ;
    x1 = coord.left();
    y1 = coord.top();
    x2 = coord.right();
    y2 = coord.bottom();
}

DrawShape::DrawShape(ShapeType typ, QPoint topLeft, QPoint botRight)
{
    type = typ;
    x1 = topLeft.x();
    y1 = topLeft.y();
    x2 = botRight.x();
    y2 = botRight.y();
}

QPoint DrawShape::topLeft() const
{
    return QPoint(x1, y1);
}
QPoint DrawShape::botRight() const
{
    return QPoint(x2, y2);
}
QRect DrawShape::coordinates() const
{
    return QRect(x1, y1, x2, y2);
}
int DrawShape::left() const
{
    return x1;
}
int DrawShape::top() const
{
    return y1;
}
int DrawShape::right() const
{
    return x2;
}
int DrawShape::bottom() const
{
    return y2;
}
ShapeType DrawShape::getType() const
{
    return type;
}
